package com.example.demo.service;

import com.example.demo.dao.ItemRepository;
import com.example.demo.dao.UsersRepository;
import com.example.demo.entity.Item;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by Administrator on 2018-4-24.
 */
@Service
public class ItemService {

    @Autowired
    private ItemRepository itemRepository;

    @Transactional(propagation = Propagation.REQUIRED)
    public Item save(Item item) {
        return itemRepository.save(item);
    }

}
